package com.huawei.esdk.tp.device.smc.v100r003c00;

import com.huawei.esdk.platform.common.SDKResult;
import com.huawei.esdk.platform.commu.itf.ICXFSOAPProtocolAdapter;
import com.huawei.esdk.platform.exception.ProtocolAdapterException;
import com.huawei.esdk.tp.device.smc.v100r002c01.SMC20V1R2C01SiteManagerCapabilityImpl;
import com.huawei.esdk.tp.device.smc.v100r003c00.SMC20V1R3C00ISiteManagerCapability;
import com.huawei.esdk.tp.device.smc.v100r003c00.convert.TPSMC20V1R3C00SiteMgrConvert;
import com.huawei.esdk.tp.domain.model.Site;
import com.huawei.esdk.tp.domain.model.bean.PagedList;
import com.huawei.esdk.tp.domain.model.bean.QuerySites;
import com.huawei.esdk.tp.southcommu.cxf.gen.v100r003c00.QuerySitesResponse;
import com.huawei.esdk.tp.southcommu.cxf.gen.v100r003c00.SmcExternal2Soap;

public class SMC20V1R3C00SiteManagerCapabilityImpl extends
SMC20V1R2C01SiteManagerCapabilityImpl implements SMC20V1R3C00ISiteManagerCapability
{

    private TPSMC20V1R3C00SiteMgrConvert convert = new TPSMC20V1R3C00SiteMgrConvert();
    /** * @param cxfSoapProtocolAdapter */
    public SMC20V1R3C00SiteManagerCapabilityImpl(
            ICXFSOAPProtocolAdapter cxfSOAPProtocolAdapter)
    {
        super(cxfSOAPProtocolAdapter);
    }

    protected String getR3SouthItfName()
    {
        return SmcExternal2Soap.class.getName();
    }

    /**
     * * 查询会场信息
     * @param query 领域bean
     * @return SDKResult 公用返回值
     */
    @Override
    public SDKResult<PagedList<Site>> querySites(QuerySites query)
    {
        com.huawei.esdk.tp.southcommu.cxf.gen.v100r003c00.QuerySites south = convert.querySites2QuerySitesSouth(query);
        QuerySitesResponse southResponse = null;
        SDKResult<PagedList<Site>> result = new  SDKResult<PagedList<Site>>();
        try
        {
            southResponse = (QuerySitesResponse) sendProtocolMessage(south, getR3SouthItfName(),
                    "querySites");
            result = convert
                    .querySitesResponseSouth2SDKResult(southResponse);
        }
        catch (ProtocolAdapterException e)
        {
            result.setErrCode(e.getErrorCode());
            return result;
        }

        return result;
    }
}
